import get_params from '@dfeidao/atom-nodejs/authorization/get-params';

import { IFeidaoAiNodejsComponent } from '@dfeidao/atom-nodejs/interfaces';
import whoami from '@dfeidao/atom-nodejs/msg/whoami';
import render from '@dfeidao/atom-nodejs/render/render';
import P06 from '../../atom/alert-title-tpl';

// import { productid } from '../../atom/config';
import p007 from './p007';

const list_title_data = [{
	width: '8%',
	type: 'checkbox'
}, {
	field: 'usercode',
	fieldtitle: '用户名',
	width: '15%',
	type: 'text'
}, {
	field: 'user_name',
	fieldtitle: '姓名',
	width: '15%',
	type: 'text'
}, {
	field: 'phone',
	fieldtitle: '手机号',
	width: '15%',
	type: 'text'
}, {
	field: 'email',
	fieldtitle: '邮箱',
	width: '17%',
	type: 'text'
}, {
	field: '',
	fieldtitle: '头像',
	width: '15%',
	type: 'none'
}, {
	field: 'is_disabled',
	fieldtitle: '是否禁用',
	width: '15%',
	type: 'radio'
}
];
export default async function na001(fd: IFeidaoAiNodejsComponent) {
	// todo
	render(fd.data.node, list_title_data, P06, 'P06');
	const user = await whoami(fd.data.actionid, fd.data.sessionid);
	const res = await get_params(fd.data.msg, fd.data.headers, user.productid, '3');
	const productid1 = res.productid;
	render(fd.data.node, { productid1 }, p007, 'p007');
}
